<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>Module: I18n</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
  <link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
  <script type="text/javascript">
  // <![CDATA[

  function popupCode( url ) {
    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
  }

  function toggleCode( id ) {
    if ( document.getElementById )
      elem = document.getElementById( id );
    else if ( document.all )
      elem = eval( "document.all." + id );
    else
      return false;

    elemStyle = elem.style;
    
    if ( elemStyle.display != "block" ) {
      elemStyle.display = "block"
    } else {
      elemStyle.display = "none"
    }

    return true;
  }
  
  // Make codeblocks hidden by default
  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
  
  // ]]>
  </script>

</head>
<body>



    <div id="classHeader">
        <table class="header-table">
        <tr class="top-aligned-row">
          <td><strong>Module</strong></td>
          <td class="class-name-in-header">I18n</td>
        </tr>
        <tr class="top-aligned-row">
            <td><strong>In:</strong></td>
            <td>
                <a href="../files/vendor/rails/activerecord/lib/active_record/i18n_interpolation_deprecation_rb.html">
                vendor/rails/activerecord/lib/active_record/i18n_interpolation_deprecation.rb
                </a>
        <br />
                <a href="../files/vendor/rails/activesupport/lib/active_support/vendor/i18n-0_0_1/i18n_rb.html">
                vendor/rails/activesupport/lib/active_support/vendor/i18n-0.0.1/i18n.rb
                </a>
        <br />
                <a href="../files/vendor/rails/activesupport/lib/active_support/vendor/i18n-0_0_1/i18n/backend/simple_rb.html">
                vendor/rails/activesupport/lib/active_support/vendor/i18n-0.0.1/i18n/backend/simple.rb
                </a>
        <br />
                <a href="../files/vendor/rails/activesupport/lib/active_support/vendor/i18n-0_0_1/i18n/exceptions_rb.html">
                vendor/rails/activesupport/lib/active_support/vendor/i18n-0.0.1/i18n/exceptions.rb
                </a>
        <br />
            </td>
        </tr>

        </table>
    </div>
  <!-- banner header -->

  <div id="bodyContent">



  <div id="contextContent">



   </div>

    <div id="method-list">
      <h3 class="section-bar">Methods</h3>

      <div class="name-list">
      <a href="#M002225">backend</a>&nbsp;&nbsp;
      <a href="#M002226">backend=</a>&nbsp;&nbsp;
      <a href="#M002237">default_exception_handler</a>&nbsp;&nbsp;
      <a href="#M002227">default_locale</a>&nbsp;&nbsp;
      <a href="#M002228">default_locale=</a>&nbsp;&nbsp;
      <a href="#M002231">exception_handler=</a>&nbsp;&nbsp;
      <a href="#M002232">load_path</a>&nbsp;&nbsp;
      <a href="#M002233">load_path=</a>&nbsp;&nbsp;
      <a href="#M002229">locale</a>&nbsp;&nbsp;
      <a href="#M002230">locale=</a>&nbsp;&nbsp;
      <a href="#M002236">localize</a>&nbsp;&nbsp;
      <a href="#M002238">normalize_translation_keys</a>&nbsp;&nbsp;
      <a href="#M002234">reload!</a>&nbsp;&nbsp;
      <a href="#M002235">translate</a>&nbsp;&nbsp;
      </div>
    </div>

  </div>


    <!-- if includes -->

    <div id="section">

    <div id="class-list">
      <h3 class="section-bar">Classes and Modules</h3>

      Module <a href="I18n/Backend.html" class="link">I18n::Backend</a><br />
Class <a href="I18n/ArgumentError.html" class="link">I18n::ArgumentError</a><br />
Class <a href="I18n/InvalidLocale.html" class="link">I18n::InvalidLocale</a><br />
Class <a href="I18n/InvalidPluralizationData.html" class="link">I18n::InvalidPluralizationData</a><br />
Class <a href="I18n/MissingInterpolationArgument.html" class="link">I18n::MissingInterpolationArgument</a><br />
Class <a href="I18n/MissingTranslationData.html" class="link">I18n::MissingTranslationData</a><br />
Class <a href="I18n/ReservedInterpolationKey.html" class="link">I18n::ReservedInterpolationKey</a><br />
Class <a href="I18n/UnknownFileType.html" class="link">I18n::UnknownFileType</a><br />

    </div>


    <div id="aliases-list">
      <h3 class="section-bar">External Aliases</h3>

      <div class="name-list">
                        <table summary="aliases">
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">translate</td>
          <td>-&gt;</td>
          <td class="context-item-value">t</td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">localize</td>
          <td>-&gt;</td>
          <td class="context-item-value">l</td>
        </tr>
                        </table>
      </div>
    </div>


      


    <!-- if method_list -->
    <div id="methods">
      <h3 class="section-bar">Public Class methods</h3>

      <div id="method-M002225" class="method-detail">
        <a name="M002225"></a>

        <div class="method-heading">
          <a href="#M002225" class="method-signature">
          <span class="method-name">backend</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Returns the current <a href="I18n.html#M002225">backend</a>. Defaults to
+<a href="I18n/Backend/Simple.html">Backend::Simple</a>+.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M002225-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M002225-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/rails/activesupport/lib/active_support/vendor/i18n-0.0.1/i18n.rb, line 19</span>
19:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">backend</span>
20:       <span class="ruby-ivar">@@backend</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">Backend</span><span class="ruby-operator">::</span><span class="ruby-constant">Simple</span>.<span class="ruby-identifier">new</span>
21:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M002226" class="method-detail">
        <a name="M002226"></a>

        <div class="method-heading">
          <a href="#M002226" class="method-signature">
          <span class="method-name">backend=</span><span class="method-args">(backend)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Sets the current <a href="I18n.html#M002225">backend</a>. Used to set a
custom <a href="I18n.html#M002225">backend</a>.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M002226-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M002226-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/rails/activesupport/lib/active_support/vendor/i18n-0.0.1/i18n.rb, line 24</span>
24:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">backend=</span>(<span class="ruby-identifier">backend</span>) 
25:       <span class="ruby-ivar">@@backend</span> = <span class="ruby-identifier">backend</span>
26:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M002227" class="method-detail">
        <a name="M002227"></a>

        <div class="method-heading">
          <a href="#M002227" class="method-signature">
          <span class="method-name">default_locale</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Returns the current default <a href="I18n.html#M002229">locale</a>.
Defaults to &#8216;en&#8216;
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M002227-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M002227-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/rails/activesupport/lib/active_support/vendor/i18n-0.0.1/i18n.rb, line 29</span>
29:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">default_locale</span>
30:       <span class="ruby-ivar">@@default_locale</span> 
31:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M002228" class="method-detail">
        <a name="M002228"></a>

        <div class="method-heading">
          <a href="#M002228" class="method-signature">
          <span class="method-name">default_locale=</span><span class="method-args">(locale)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Sets the current default <a href="I18n.html#M002229">locale</a>. Used to
set a custom default <a href="I18n.html#M002229">locale</a>.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M002228-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M002228-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/rails/activesupport/lib/active_support/vendor/i18n-0.0.1/i18n.rb, line 34</span>
34:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">default_locale=</span>(<span class="ruby-identifier">locale</span>) 
35:       <span class="ruby-ivar">@@default_locale</span> = <span class="ruby-identifier">locale</span> 
36:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M002231" class="method-detail">
        <a name="M002231"></a>

        <div class="method-heading">
          <a href="#M002231" class="method-signature">
          <span class="method-name">exception_handler=</span><span class="method-args">(exception_handler)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Sets the exception handler.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M002231-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M002231-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/rails/activesupport/lib/active_support/vendor/i18n-0.0.1/i18n.rb, line 49</span>
49:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">exception_handler=</span>(<span class="ruby-identifier">exception_handler</span>)
50:       <span class="ruby-ivar">@@exception_handler</span> = <span class="ruby-identifier">exception_handler</span>
51:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M002232" class="method-detail">
        <a name="M002232"></a>

        <div class="method-heading">
          <a href="#M002232" class="method-signature">
          <span class="method-name">load_path</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Allow clients to register paths providing translation data sources. The <a
href="I18n.html#M002225">backend</a> defines acceptable sources.
</p>
<p>
E.g. the provided SimpleBackend accepts a list of paths to translation
files which are either named *.rb and contain plain Ruby Hashes or are
named *.yml and contain YAML data. So for the SimpleBackend clients may
register translation files like this:
</p>
<pre>
  I18n.load_path &lt;&lt; 'path/to/locale/en.yml'
</pre>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M002232-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M002232-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/rails/activesupport/lib/active_support/vendor/i18n-0.0.1/i18n.rb, line 61</span>
61:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">load_path</span>
62:       <span class="ruby-ivar">@@load_path</span> <span class="ruby-operator">||=</span> []
63:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M002233" class="method-detail">
        <a name="M002233"></a>

        <div class="method-heading">
          <a href="#M002233" class="method-signature">
          <span class="method-name">load_path=</span><span class="method-args">(load_path)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Sets the load path instance. Custom implementations are expected to behave
like a Ruby Array.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M002233-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M002233-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/rails/activesupport/lib/active_support/vendor/i18n-0.0.1/i18n.rb, line 67</span>
67:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">load_path=</span>(<span class="ruby-identifier">load_path</span>)
68:       <span class="ruby-ivar">@@load_path</span> = <span class="ruby-identifier">load_path</span>
69:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M002229" class="method-detail">
        <a name="M002229"></a>

        <div class="method-heading">
          <a href="#M002229" class="method-signature">
          <span class="method-name">locale</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Returns the current <a href="I18n.html#M002229">locale</a>. Defaults to <a
href="I18n.html#M002227">I18n.default_locale</a>.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M002229-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M002229-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/rails/activesupport/lib/active_support/vendor/i18n-0.0.1/i18n.rb, line 39</span>
39:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">locale</span>
40:       <span class="ruby-constant">Thread</span>.<span class="ruby-identifier">current</span>[<span class="ruby-identifier">:locale</span>] <span class="ruby-operator">||=</span> <span class="ruby-identifier">default_locale</span>
41:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M002230" class="method-detail">
        <a name="M002230"></a>

        <div class="method-heading">
          <a href="#M002230" class="method-signature">
          <span class="method-name">locale=</span><span class="method-args">(locale)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Sets the current <a href="I18n.html#M002229">locale</a> pseudo-globally,
i.e. in the Thread.current hash.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M002230-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M002230-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/rails/activesupport/lib/active_support/vendor/i18n-0.0.1/i18n.rb, line 44</span>
44:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">locale=</span>(<span class="ruby-identifier">locale</span>)
45:       <span class="ruby-constant">Thread</span>.<span class="ruby-identifier">current</span>[<span class="ruby-identifier">:locale</span>] = <span class="ruby-identifier">locale</span>
46:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M002236" class="method-detail">
        <a name="M002236"></a>

        <div class="method-heading">
          <a href="#M002236" class="method-signature">
          <span class="method-name">localize</span><span class="method-args">(object, options = {})</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Localizes certain objects, such as dates and numbers to local formatting.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M002236-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M002236-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/activesupport/lib/active_support/vendor/i18n-0.0.1/i18n.rb, line 168</span>
168:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">localize</span>(<span class="ruby-identifier">object</span>, <span class="ruby-identifier">options</span> = {})
169:       <span class="ruby-identifier">locale</span> = <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:locale</span>] <span class="ruby-operator">||</span> <span class="ruby-constant">I18n</span>.<span class="ruby-identifier">locale</span>
170:       <span class="ruby-identifier">format</span> = <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:format</span>] <span class="ruby-operator">||</span> <span class="ruby-identifier">:default</span>
171:       <span class="ruby-identifier">backend</span>.<span class="ruby-identifier">localize</span>(<span class="ruby-identifier">locale</span>, <span class="ruby-identifier">object</span>, <span class="ruby-identifier">format</span>)
172:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M002234" class="method-detail">
        <a name="M002234"></a>

        <div class="method-heading">
          <a href="#M002234" class="method-signature">
          <span class="method-name">reload!</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Tells the <a href="I18n.html#M002225">backend</a> to reload translations.
Used in situations like the <a href="Rails.html">Rails</a> development
environment. Backends can implement whatever strategy is useful.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M002234-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M002234-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/rails/activesupport/lib/active_support/vendor/i18n-0.0.1/i18n.rb, line 74</span>
74:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">reload!</span>
75:       <span class="ruby-identifier">backend</span>.<span class="ruby-identifier">reload!</span>
76:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M002235" class="method-detail">
        <a name="M002235"></a>

        <div class="method-heading">
          <a href="#M002235" class="method-signature">
          <span class="method-name">translate</span><span class="method-args">(key, options = {})</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Translates, pluralizes and interpolates a given key using a given <a
href="I18n.html#M002229">locale</a>, scope, and default, as well as
interpolation values.
</p>
<p>
<b>LOOKUP</b>
</p>
<p>
Translation data is organized as a nested hash using the upper-level keys
as namespaces. <em>E.g.</em>, ActionView ships with the translation:
<tt>:date =&gt; {:formats =&gt; {:short =&gt; &quot;%b %d&quot;}}</tt>.
</p>
<p>
Translations can be looked up at any level of this hash using the key
argument and the scope option. <em>E.g.</em>, in this example <tt>I18n.t
:date</tt> returns the whole translations hash <tt>{:formats =&gt; {:short
=&gt; &quot;%b %d&quot;}}</tt>.
</p>
<p>
Key can be either a single key or a dot-separated key (both Strings and
Symbols work). <em>E.g.</em>, the short format can be looked up using both:
</p>
<pre>
  I18n.t 'date.formats.short'
  I18n.t :'date.formats.short'
</pre>
<p>
Scope can be either a single key, a dot-separated key or an array of keys
or dot-separated keys. Keys and scopes can be combined freely. So these
examples will all look up the same short date format:
</p>
<pre>
  I18n.t 'date.formats.short'
  I18n.t 'formats.short', :scope =&gt; 'date'
  I18n.t 'short', :scope =&gt; 'date.formats'
  I18n.t 'short', :scope =&gt; %w(date formats)
</pre>
<p>
<b>INTERPOLATION</b>
</p>
<p>
Translations can contain interpolation variables which will be replaced by
values passed to <a href="I18n.html#M002235">translate</a> as part of the
options hash, with the keys matching the interpolation variable names.
</p>
<p>
<em>E.g.</em>, with a translation <tt>:foo =&gt; &quot;foo
{{bar}}&quot;</tt> the option value for the key <tt>bar</tt> will be
interpolated into the translation:
</p>
<pre>
  I18n.t :foo, :bar =&gt; 'baz' # =&gt; 'foo baz'
</pre>
<p>
<b>PLURALIZATION</b>
</p>
<p>
Translation data can contain pluralized translations. Pluralized
translations are arrays of singluar/plural versions of translations like
<tt>[&#8216;Foo&#8217;, &#8216;Foos&#8217;]</tt>.
</p>
<p>
Note that <tt><a
href="I18n/Backend/Simple.html">I18n::Backend::Simple</a></tt> only
supports an algorithm for English pluralization rules. Other algorithms can
be supported by custom backends.
</p>
<p>
This returns the singular version of a pluralized translation:
</p>
<pre>
  I18n.t :foo, :count =&gt; 1 # =&gt; 'Foo'
</pre>
<p>
These both return the plural version of a pluralized translation:
</p>
<pre>
  I18n.t :foo, :count =&gt; 0 # =&gt; 'Foos'
  I18n.t :foo, :count =&gt; 2 # =&gt; 'Foos'
</pre>
<p>
The <tt>:count</tt> option can be used both for pluralization and
interpolation. <em>E.g.</em>, with the translation <tt>:foo =&gt;
[&#8217;{{count}} foo&#8217;, &#8217;{{count}} foos&#8217;]</tt>, count
will be interpolated to the pluralized translation:
</p>
<pre>
  I18n.t :foo, :count =&gt; 1 # =&gt; '1 foo'
</pre>
<p>
<b>DEFAULTS</b>
</p>
<p>
This returns the translation for <tt>:foo</tt> or <tt>default</tt> if no
translation was found:
</p>
<pre>
  I18n.t :foo, :default =&gt; 'default'
</pre>
<p>
This returns the translation for <tt>:foo</tt> or the translation for
<tt>:bar</tt> if no translation for <tt>:foo</tt> was found:
</p>
<pre>
  I18n.t :foo, :default =&gt; :bar
</pre>
<p>
Returns the translation for <tt>:foo</tt> or the translation for
<tt>:bar</tt> or <tt>default</tt> if no translations for <tt>:foo</tt> and
<tt>:bar</tt> were found.
</p>
<pre>
  I18n.t :foo, :default =&gt; [:bar, 'default']
</pre>
<p>
<b>BULK LOOKUP</b>
</p>
<p>
This returns an array with the translations for <tt>:foo</tt> and
<tt>:bar</tt>.
</p>
<pre>
  I18n.t [:foo, :bar]
</pre>
<p>
Can be used with dot-separated nested keys:
</p>
<pre>
  I18n.t [:'baz.foo', :'baz.bar']
</pre>
<p>
Which is the same as using a scope option:
</p>
<pre>
  I18n.t [:foo, :bar], :scope =&gt; :baz
</pre>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M002235-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M002235-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/activesupport/lib/active_support/vendor/i18n-0.0.1/i18n.rb, line 158</span>
158:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">translate</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">options</span> = {})
159:       <span class="ruby-identifier">locale</span> = <span class="ruby-identifier">options</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">:locale</span>) <span class="ruby-operator">||</span> <span class="ruby-constant">I18n</span>.<span class="ruby-identifier">locale</span>
160:       <span class="ruby-identifier">backend</span>.<span class="ruby-identifier">translate</span>(<span class="ruby-identifier">locale</span>, <span class="ruby-identifier">key</span>, <span class="ruby-identifier">options</span>)
161:     <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">I18n</span><span class="ruby-operator">::</span><span class="ruby-constant">ArgumentError</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
162:       <span class="ruby-identifier">raise</span> <span class="ruby-identifier">e</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:raise</span>]
163:       <span class="ruby-identifier">send</span>(<span class="ruby-ivar">@@exception_handler</span>, <span class="ruby-identifier">e</span>, <span class="ruby-identifier">locale</span>, <span class="ruby-identifier">key</span>, <span class="ruby-identifier">options</span>)
164:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <h3 class="section-bar">Protected Class methods</h3>

      <div id="method-M002237" class="method-detail">
        <a name="M002237"></a>

        <div class="method-heading">
          <a href="#M002237" class="method-signature">
          <span class="method-name">default_exception_handler</span><span class="method-args">(exception, locale, key, options)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Handles exceptions raised in the <a href="I18n.html#M002225">backend</a>.
All exceptions except for <a
href="I18n/MissingTranslationData.html">MissingTranslationData</a>
exceptions are re-raised. When a <a
href="I18n/MissingTranslationData.html">MissingTranslationData</a> was
caught and the option :raise is not set the handler returns an error
message string containing the key/scope.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M002237-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M002237-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/activesupport/lib/active_support/vendor/i18n-0.0.1/i18n.rb, line 180</span>
180:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">default_exception_handler</span>(<span class="ruby-identifier">exception</span>, <span class="ruby-identifier">locale</span>, <span class="ruby-identifier">key</span>, <span class="ruby-identifier">options</span>)
181:       <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">exception</span>.<span class="ruby-identifier">message</span> <span class="ruby-keyword kw">if</span> <span class="ruby-constant">MissingTranslationData</span> <span class="ruby-operator">===</span> <span class="ruby-identifier">exception</span>
182:       <span class="ruby-identifier">raise</span> <span class="ruby-identifier">exception</span>
183:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M002238" class="method-detail">
        <a name="M002238"></a>

        <div class="method-heading">
          <a href="#M002238" class="method-signature">
          <span class="method-name">normalize_translation_keys</span><span class="method-args">(locale, key, scope)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Merges the given <a href="I18n.html#M002229">locale</a>, key and scope into
a single array of keys. Splits keys that contain dots into multiple keys.
Makes sure all keys are Symbols.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M002238-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M002238-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/activesupport/lib/active_support/vendor/i18n-0.0.1/i18n.rb, line 188</span>
188:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">normalize_translation_keys</span>(<span class="ruby-identifier">locale</span>, <span class="ruby-identifier">key</span>, <span class="ruby-identifier">scope</span>)
189:       <span class="ruby-identifier">keys</span> = [<span class="ruby-identifier">locale</span>] <span class="ruby-operator">+</span> <span class="ruby-constant">Array</span>(<span class="ruby-identifier">scope</span>) <span class="ruby-operator">+</span> [<span class="ruby-identifier">key</span>]
190:       <span class="ruby-identifier">keys</span> = <span class="ruby-identifier">keys</span>.<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">k</span><span class="ruby-operator">|</span> <span class="ruby-identifier">k</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">split</span>(<span class="ruby-regexp re">/\./</span>) }
191:       <span class="ruby-identifier">keys</span>.<span class="ruby-identifier">flatten</span>.<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">k</span><span class="ruby-operator">|</span> <span class="ruby-identifier">k</span>.<span class="ruby-identifier">to_sym</span> }
192:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>


    </div>


  </div>


<div id="validator-badges">
  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>

</body>
</html>